package com.tos.uc.dao;

import com.tos.uc.domain.TosUser;
import com.tos.uc.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * Created by yanfei on 2017/6/27.
 */
@Mapper
public interface IUserDao {
    User getUserById(int id);

    TosUser checkUserExist(String phoneNumber);

    TosUser checkNicknameExist(String nickname);

    TosUser checkCode(@Param(value = "code") String code,@Param(value = "mphone") String phoneNumber);

    void updateUserInfo(@Param(value = "password") String password,@Param(value = "nickname") String nickName,@Param(value = "userFrom") Integer userFrom,@Param(value = "userId") Integer id);

    void updateToken(@Param(value = "token") String token,@Param(value = "userId") Integer id);

    int updateUserPassword(@Param(value = "mphone") String mphone,@Param(value = "password") String password);

    TosUser checkLogin(@Param(value = "mphone") String phoneNumber,@Param(value = "password") String passWord);

    void updateUserCode(@Param("code") String codeMd5,@Param(value = "userId") int userId);

    void addUser(TosUser u);
}
